<!DOCTYPE HTML>
<html>
<head>
	<title>预约信息</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link href="css/style.css" rel="stylesheet" type="text/css"  media="all" />
	<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
	<link href="css/slider.css" rel="stylesheet" type="text/css"  media="all" />
	<script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
	<script type="text/javascript" src="js/jquery.nivo.slider.js"></script>
	<script type="text/javascript">
        $(window).load(function() {
            var path = "/" + location.pathname.split("/")[1];
            $.post(path+"/S_getImage",function (data) {
                console.log(data);
                $.each(data,function (i,li) {
                    console.log(li.imagePath);
                    $("#slider").append(
                        '<img src="'+path+"/"+li.imagePath+'" data-thumb="'+path+"/"+li.imagePath+'"  alt="" />'
                    );
                });
                $('#slider').nivoSlider();
            },'json');
            var club;
            /*获取所有的店铺*/
            $.get(path+"/S_getClub",function (date) {
                console.log(date);
                club=date;
                var id=date[0].clubId;
                $.each(date,function (i,obj) {
                    $("#clubselect").append(
                        '<option value="'+i+'">'+obj.clubName+'</option>'
                    );
                });
                $.each(date[0].shopSet,function (i,obj) {
                    $("#shopselect").append(
                        '<option value="'+obj.shopid+'">'+obj.shopname+'</option>'
                    );
                });
                getinfo(date[0].shopSet[0].shopid);
            },"json");
            $("#clubselect").change(function () {
                $("#course").empty();
                $("#shopselect").empty();
                $.each(club[this.value].shopSet,function (i,obj) {
                    $("#shopselect").append(
                        '<option value="'+obj.shopid+'">'+obj.shopname+'</option>'
                    );
                });
                getinfo(club[this.value].shopSet[0].shopid);
            });
            /*分店改变的时候获取分店的id*/
            /*获取第一个总店中第一个分店的id*/
            $("#shopselect").change(function () {
                var shopid=this.value;
                console.log(shopid);
                $("#course").empty();
                getinfo(shopid);
            });
            function getinfo(id){
                $.get(path+"/"+"S_getInfo?clubid="+id,function (date1) {
                    console.log(date1);
                    $.each(date1,function (i,date) {
                        $("#info").append(
                            '<div class="grid_1_of_3 images_1_of_3 top_grid" style="margin-top: 0px;margin-left: 0px;margin-right: 10px">'+
                            '<h3>'+date.aboutcourseName+'</h3>'+
                            '<img src="'+date.aboutcourseImg+'" alt=""style="width: 400px;height: 230px"/>'+
                            '<span>课程类型</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>'+date.aboutcourseCategory+'</span><br>'+
                            '<span>日期</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>'+date.aboutcourseDate+'</span><br>'+
                            '<span>时间</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>'+date.aboutcourseTime+'</span><br>'+
                            '<span>教室</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>'+date.abourcourseClassroom+'</span><br>'+
                            '<span>状态</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>'+date.aboutcourseStatus+'</span><br>'+
                            '<div class="button"><span><a href="/SWT/S_deleteInfo?aboutcourseId='+date.aboutcourseId+'">取消预约</a></span></div>'+
                            '</div>'
                        );
                    });
                },"json");
            };
        });
	</script>
</head>
<body>
<!----start-header----->
<!---start-top-nav---->
<div class="header">
	<div class="wrap">
		<!---start-top-nav---->
		<div class="top-header">
			<div class="logo">
				<span style="color: pink">总店</span>
				<select id="clubselect">
				</select>
				<span style="color: pink">分店</span>
				<select id="shopselect">
				</select>
			</div>
			<div class="clear"> </div>
		</div>
		<!---start-top-nav---->
		<div class="top-nav">
			<div class="top-nav-left">
				<ul>
					<li><a href="person.html">个人信息</a></li>
					<li><a href="index.html">约个课</a></li>
					<li ><a href="personal.html">约私教</a></li>
					<li class="active"><a href="info.html">预约信息</a></li>
					<li><a href="club.html">场馆信息</a></li>
					<li ><a href="vipcard.html">我的会员卡</a></li>
					<div class="clear"> </div>
				</ul>
			</div>
			<div class="top-nav-right">
				<div class="telephone">
					<span><i class="phone_img"><img src="images/phone.png" alt="" /></i> CALL</span><span class="number">(800) 234-5678</span>
				</div>
			</div>
			<div class="clear"> </div>
		</div>
		<!---End-top-nav---->
	</div>
</div>
<!----End-header----->
<!------ Slider ------------>
<div class="slider">
	<div class="slider-wrapper theme-default">
		<div id="slider" class="nivoSlider">
		</div>
	</div>
</div>
<!------End Slider ------------>
<!---start-content---->
<div class="wrap">
	<div class="content">
		<div class="top-grids">
			<div class="section group" id="info">
				<!--<div class="grid_1_of_3 images_1_of_3 top_grid" style="margin-top: 0px;margin-left: 0px;margin-right: 10px">			 <h3>店铺名</h3>
                      <img src="images/welcome_img2.jpg" alt="" />
                      <span>卡类型</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>季卡</span><br>
                      <span>状态</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>使用中</span><br>
                      <span>到期时间</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2018-11-28</span><br>
                      <span>适用场馆</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>青云</span>
                </div>-->
			</div>
		</div>

	</div>
	<!---End-content---->
</body>
</html>

